package com.blockchain.front.servlets.security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.blockchain.framework.service.ServiceSession;
import com.blockchain.front.service.security.SecurityManage;
import com.blockchain.util.parser.IntegerParser;

public class Bank extends AbstractSceurityServlet {

	private static final long serialVersionUID = 1L;

	@Override
	protected void processPost(HttpServletRequest request, HttpServletResponse response, ServiceSession serviceSession)
			throws Throwable {
		String bq = request.getParameter("bq");
		int yhid = IntegerParser.parse(request.getParameter("yhid"));
		String sheng = request.getParameter("sheng");
		String shi = request.getParameter("shi");
		String khzh = request.getParameter("khzh");
		String kh = request.getParameter("kh");
		String jymm = request.getParameter("jymm");
		SecurityManage manage = serviceSession.getService(SecurityManage.class);
		manage.addBank(bq, yhid, sheng, shi, khzh, kh, jymm);
		sendRedirect(request, response, getController().getURI(request, Bank.class));
	}

}